import { RouteRecordRaw } from 'vue-router';
import { Layout } from '@/router/constant';
import { OrderedListOutlined } from '@vicons/antd';
import { renderIcon } from '@/utils/index';
/**
 * @param name 路由名称, 必须设置,且不能重名
 * @param meta 路由元信息（路由附带扩展信息）
 * @param redirect 重定向地址, 访问这个路由时,自定进行重定向
 * @param meta.disabled 禁用整个菜单
 * @param meta.title 菜单名称
 * @param meta.icon 菜单图标
 * @param meta.keepAlive 缓存该路由
 * @param meta.sort 排序越小越排前
 *
 * */
const routes: Array<RouteRecordRaw> = [
  {
    path: '/weight',
    name: 'weight',
    redirect: '/weight/weight',
    component: Layout,
    meta: {
      title: '称重管理',
      icon: renderIcon(OrderedListOutlined),
      permissions: ['weight'],
      sort: 4,
    },
    children: [
      {
        path: 'weight-list',
        name: 'weightList',
        meta: {
          title: '称重列表',
          permissions: ['weight'],
          //keepAlive: true,
        },
        component: () => import('@/views/weight/weightList/index.vue'),
      },
      {
        path: 'settlement-list',
        name: 'settlementList',
        meta: {
          title: '结算列表',
          permissions: ['settlement'],
              //keepAlive: true,
        },
        component: () => import('@/views/weight/settlementList/index.vue'),
      },
      {
        path: 'weight-update-list',
        name: 'weightUpdateList',
        meta: {
          title: '称重更新列表',
          permissions: ['weightUpdate'],
              //keepAlive: true,
        },
        component: () => import('@/views/weight/weightUpdateList/index.vue'),
      },
      {
        path: 'goods-type-list',
        name: 'goodsTypeList',
        meta: {
          title: '商品类型列表',
          permissions: ['goodsType'],
              //keepAlive: true,
        },
        component: () => import('@/views/weight/goodsTypeList/index.vue'),
      },
      // {
      //   path: 'goods-price-analyse',
      //   name: 'goodsPriceAnalyse',
      //   meta: {
      //     title: '商品价格分析',
      //     permissions: ['goodsPriceAnalyse'],
      //         //keepAlive: true,
      //   },
      //   component: () => import('@/views/weight/goodsPriceAnalyse/index.vue'),
      // },
    ],
  },
];
export default routes;
